package com.zzyl.controller.customer;

import com.zzyl.base.ResponseResult;
import com.zzyl.controller.BaseController;
import com.zzyl.dto.UserLoginRequestDto;
import com.zzyl.service.MemberService;
import com.zzyl.vo.LoginVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 用户管理
 */
@Slf4j
@Api(tags = "客户管理")
@RestController
@RequestMapping("/customer/user")
@RequiredArgsConstructor
public class CustomerUserController extends BaseController {


    private final MemberService memberService;


    @ApiOperation("微信登录")
    @PostMapping("login")
    public ResponseResult<LoginVo> login(@RequestBody UserLoginRequestDto dto) {
        log.info("微信登录：{}",dto);
        LoginVo login = memberService.login(dto);
        return ResponseResult.success(login);
    }

}
